
typedef struct 
{
    volatile unsigned int MODER;    // MODER   Address: 0x50006000
    volatile unsigned int OTYPER;   // OTYPER  Address: 0x50006000
    volatile unsigned int OSPEEDR;  // OSPEEDR Address: 0x50006008
    volatile unsigned int PUPDR;    // PUPDR   Address: 0x5000600C
    volatile unsigned int IDR;      // IDR     Address: 0x50006010
    volatile unsigned int ODR;      // ODR     Address: 0x50006014
}GPIO_Typedef __attribute__((aligned(4)));

#define GPIOE ((GPIO_Typedef *) 0x50006000) //GPIOE Base Address
#define RCC_MC_AHB4ENCLRR *((volatile unsigned int *)0x50000A28)

void Led_Blink()
{
    //使能GPIOE模块的时钟
    RCC_MC_AHB4ENCLRR |= (0x1 << 4);
    //PE10配置为输出模式
    GPIOE->MODER &= ~(0x3 << 20);
    //PE10配置为推挽输出
    GPIOE->OTYPER &= ~(0x1 << 10);
    //PE10配置为低速
    GPIOE->OSPEEDR &= ~(0x3 << 20);
    //PE10配置为断开上下拉电阻
    GPIOE->PUPDR &= ~(0x3 << 20);
    while(1)
    {
        //PE10输出高电平
        GPIOE->ODR |= (0x1 << 10);
        //延时
        for (volatile int i = 0; i < 100000; i++);
        //PE10输出低电平
        GPIOE->ODR &= ~(0x1 << 10);
        //延时
        for (volatile int i = 0; i < 100000; i++);
    }
}

















